package hongcaosp.app.android.user.settings.wallet.holder;

import android.view.View;
import android.widget.TextView;

import hongcaosp.app.android.R;
import hongcaosp.app.android.common.BaseHolder;
import hongcaosp.app.android.modle.bean.ChargeMoney;
import xlj.lib.android.base.view.OnRecycleItemClickListener;

/**
 * 充值金额项
 */
public class ChargeMoneyHolder extends BaseHolder<ChargeMoney> {

    private TextView tv_money;

    public ChargeMoneyHolder(View itemView, OnRecycleItemClickListener recycleItemClickListener) {
        super(itemView, recycleItemClickListener);
        tv_money = (TextView) itemView;
    }

    @Override
    public void setData(ChargeMoney data) {
        super.setData(data);
        tv_money.setText(data.getPayPrice() + "元");

        int bg = R.drawable.bg_charge_money;
        int color = R.color.color_red;
        if (!data.isSelect()) {
            bg = R.drawable.bg_charge_money_1;
            color = R.color.white;
        }
        tv_money.setBackgroundResource(bg);
        tv_money.setTextColor(tv_money.getContext().getResources().getColor(color));
    }
}
